from file_dir import file_list

files_dir = r'D:\data\RegularNovel\终末的绅士'

def replacement(file_name, replacements):
    with open(file_name, 'r', encoding='utf-8') as f:
        content = f.read()
        content = content.replace('\n', '')
        for replacement in replacements:
            content = content.replace(replacement, '')
        with open(file_name, 'w', encoding='utf-8') as f:
            f.write(content)

if __name__ == '__main__':
    replacements = [
        '最新网址：www.35wx.la',
        '平日喜欢看各类小说、玩游戏的他，第一时间便联想到一个关键词-【穿',
    ]
    files = file_list.get_all_files(files_dir)
    for file in files:
        replacement(file, replacements)

    print('Done')
